﻿using UnityEngine;

public class BuffExhausted : BuffBase
{
    public int TotalAtkFix = 0;
    public BuffExhausted() : base()
    {
        Type = BuffType.Exhausted;
    }

    public static bool CheckCondition(UnitBase unit)
    {
        if (unit.HasBuff(BuffType.Exhausted)) return false;
        if (unit.ap == 0 && !unit.HasBuff(BuffType.Chaos)) return true;
        return false;
    }

    public override void OnCreate()
    {

    }

    public override void OnDispose()
    {
        Owner.atk_fix += TotalAtkFix;
    }

    public override void OnEndPhase()
    {
        Owner.atk_fix -= 1;
        TotalAtkFix += 1;
    }
    public override string ToString()
    {
        return "疲劳：每个回合都会损失攻击力；休息可以复原";
    }
}